﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.IO;

namespace MyWcfRestLib.Files
{
    [DataContract]
    public class ChunkUploadInfo
    {
        [DataMember(Name = "upload_id")]
        public string UploadID { get; set; }

        [DataMember(Name = "offset")]
        public long Offset { get; set; }

        [DataMember(Name = "expires")]
        public string ExpireTime { get; set; }

        internal string BasePath { get; set; }
        internal string RootFolder { get; set; }
        internal string TempFolder { get; set; }
        internal string TempName { get; set; }
    }

    [DataContract]
    public class MetadataInfo
    {
        [DataMember(Name = "size")]
        public string SizeString { get; set; }

        [DataMember(Name = "thumb_exists")]
        public bool IsThumbExist { get; set; }

        [DataMember(Name = "bytes")]
        public long FileSize { get; set; }

        [DataMember(Name = "modified")]
        public string ModifiedTime { get; set; }

        [DataMember(Name = "path")]
        public string RelativePath { get; set; }

        [DataMember(Name = "is_dir")]
        public bool IsDir { get; set; }

        [DataMember(Name = "icon")]
        public string IconName { get; set; }

        /// <summary>
        /// Gets or sets the root.
        /// It is the root folder of a device. Normally, value is the name of the device to identify a device.
        /// E.g., "MB525"
        /// </summary>
        /// <value>
        /// The root.
        /// </value>
        [DataMember(Name = "root")]
        public string Root { get; set; }

        public string RealPath { get; set; }

        [DataMember(Name = "rev")]
        public long Revision { get; set; }

        /// <summary>
        /// Gets or sets the type of the MIME.
        /// Only valid on "file" object
        /// </summary>
        /// <value>
        /// The type of the MIME.
        /// </value>
        [DataMember(Name = "mime_type")]
        public string MimeType { get; set; }

        /// <summary>
        /// Gets or sets the contents.
        /// Only valid on "folder" object
        /// </summary>
        /// <value>
        /// The contents.
        /// </value>
        [DataMember(Name = "contents")]
        public MetadataInfo[] Contents { get; set; }

    }
    
}
